package com.itheima.demo;

import com.itheima.dao.UserDao;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class UserDemo {
    public static void main(String[] args) {
        //读取spring核心配置文件
        ApplicationContext classPathXmlApplicationContext = new ClassPathXmlApplicationContext("applicationContext.xml");
        //获取spring创建的bean
        UserDao userDao = (UserDao) classPathXmlApplicationContext.getBean("userDao");
        userDao.save();
    }
}
